package InputTest;

import junit.framework.TestCase;
import pop6.Board;

public class InputTest extends TestCase {
	private Board board;

	public void setUp() {
		board = new Board();
	}

	// Test case 1: balltype = 0
	public void testball0() {

		char testballtype = '0';
		boolean issame = true;
		board.getNextBall(testballtype);

		char testarray[][] = new char[6][6];
		for (int i = 0; i < 6; i++) {
			testarray[0][i] = '0';
		}
		testarray[1][0] = '0';
		testarray[2][0] = '0';

		for (int i = 0; i < 6; i++) {
			for (int j = 0; j < 6; j++)
				if (board.ballArray[i][j].getType() != testarray[i][j])
					issame = false;
		}
		assertTrue(issame);

	}

	// Test case 2: balltype = 3
	public void testball3() {

		char testballtype = '3';
		boolean issame = true;
		board.getNextBall(testballtype);

		char testarray[][] = new char[6][6];
		for (int i = 0; i < 6; i++)
			testarray[0][i] = '0';
		testarray[1][0] = '0';

		for (int i = 0; i < 6; i++) {
			for (int j = 0; j < 6; j++)
				if (board.ballArray[i][j].getType() != testarray[ i ][ j ])
					issame = false;
		}
		assertTrue(issame);

	}

}
